const App = getApp()
Page({
  data: {
    list: [],
    firstMenu: {}
  },
  onLoad () {
    let firstMenu = wx.getStorageSync('firstMenu')
    this.setData({firstMenu})
    wx.showNavigationBarLoading()
    this.getList(() => {
      wx.hideNavigationBarLoading()
    })
  },
  getList (cb) {
    let firstMenu = this.data.firstMenu
    App.HttpService.getSecond({ bandId: firstMenu.id }).then(res => {
      cb && cb()
      let data = res.data
      if (data.code == 200) {
        this.setData({
          list: data.data
        })
      }
    })
  },
  toNext (e) {
    let secondMenu = e.currentTarget.dataset
  
    wx.setStorageSync('secondMenu', secondMenu)
    wx.navigateTo({
      url: '/pages/car/thirdMenu/index'
    })
  }
})